<template>
  <div>
    <div align="left"><B>
      用户信息</B></div>
    <formItem ismust="" cname="no">
      <input slot="input" type="text" id="user_item.no"  style="width:20px" v-model:value="user_item.no"/>
    </formItem>
    <formItem ismust="*" cname="名称">
      <input slot="input" type="text" id="user_item.name" v-model="user_item.name"  style="width:50px">
    </formItem>
    <formItem ismust="" cname="中文名称">
      <input slot="input" type="text" id="user_item.cname" v-model="user_item.cname" style="width:150px"/>
    </formItem>
    <div align="left">
    <input type="button" value="read" v-on:click="read()" />
    <input type="button" value="write" v-on:click="write(' this is a test')" /></div>
  </div>
</template>

<script>
  import formItem from "./formItem"
  export default {
    name: 'user-item',
  props: {user_item:{"no":"String", "name":"String","cname":"String"}},
    components:{formItem},
    methods:{
      read:function(){return alert("read:" + this.user_item.name);},
      write:function(msg){return alert("write:" + msg);},
      read_ex:function(){
      }
    }
  }
</script>

<style scoped>
  @import url("../css/page.css");
</style>
